package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * GoodsStandard entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_GOODS_STANDARD", schema = "HCD_DEV")
public class GoodsStandard extends Entity implements java.io.Serializable {

	// Fields

	private GoodsStandardId id;
	private StoreGoods storeGoods;
	private Goods goods;

	// Constructors

	/** default constructor */
	public GoodsStandard() {
	}

	/** minimal constructor */
	public GoodsStandard(GoodsStandardId id) {
		this.id = id;
	}

	/** full constructor */
	public GoodsStandard(GoodsStandardId id, StoreGoods storeGoods, Goods goods) {
		this.id = id;
		this.storeGoods = storeGoods;
		this.goods = goods;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "catId", column = @Column(name = "CAT_ID", nullable = false, precision = 15, scale = 0)),
			@AttributeOverride(name = "storeGoodsId", column = @Column(name = "STORE_GOODS_ID", precision = 15, scale = 0)),
			@AttributeOverride(name = "goodsId", column = @Column(name = "GOODS_ID", precision = 15, scale = 0)) })
	public GoodsStandardId getId() {
		return this.id;
	}

	public void setId(GoodsStandardId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STORE_GOODS_ID", insertable = false, updatable = false)
	public StoreGoods getStoreGoods() {
		return this.storeGoods;
	}

	public void setStoreGoods(StoreGoods storeGoods) {
		this.storeGoods = storeGoods;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "GOODS_ID", insertable = false, updatable = false)
	public Goods getGoods() {
		return this.goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}

}